import request from '@/utils/request'

export function loginByUsername(username, password) {
  const data = {
    userNameOrEmailAddress: username,
    password: password,
    rememberClient: true
  }
  return request({
    url: '/TokenAuth/Authenticate',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/login/logout',
    method: 'post'
  })
}

export function getUserInfo() {
  return request({
    url: '/services/app/User/GetUserInfo',
    method: 'get',
    params: { id: 0 }
  })
}
